function timeChange(time, type, num, separator = '-') {
	// 兼容苹果系统
	if(typeof(time) === 'string'){
		time = time.replace(new RegExp('-', 'g'), '/');
		time = new Date(time);
	}
	let output = new Date(time.getTime() + (num * 24 * 60 * 60 * 1000))
	let year = output.getFullYear()
	let month = output.getMonth() > 8 ? output.getMonth() + 1 : "0" + (output.getMonth() + 1)
	let date = output.getDate() > 9 ? output.getDate() : "0" + output.getDate()
	if (type === 'date') {
		return year + separator + month + separator + date
	}
	if (type === 'month') {
		return year + separator + month
	}
	if (type === 'pointMonthRange') {
		let nextYear = Number(month) > 11 ? year + 1 : year
		let nextMonth = Number(month) > 11 ? '01' : Number(month) > 9 ? Number(month) + 1 : "0" + (Number(month) + 1)
		let endTime = new Date(new Date(nextYear + '/' + nextMonth + '/01 00:00:00').getTime() - 10000)
		return {
			startTime: year + separator + month + separator + '01',
			endTime: year + separator + month + separator + (endTime.getDate() > 9 ? endTime.getDate() : "0" + endTime
				.getDate())
		}
	}
}

export default timeChange;